
 <?php
$global=isSupperManagerForSession();
 ?>

   <section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
          <span data-url="/admin/devtype/lists"  onclick="ContentLoadGo('/admin/devtype/lists')">资产分类</span>
         >
         <span data-url="/admin/devtype2/lists" data-container="rt_content" data-param-pid="<?php echo $pid; ?>"   class="topBannerItem">子项分类</span>
         </div>
      </section>
      <section style="margin-top:10px;margin-left:auto;margin-right:auto;">
      <select name="ser_key" id="ser_key" class="select" >
       <option value="dname" <?php if($request['ser_key']=="dname"){echo 'selected';} ?>>分类名称</option>
       <option value="abb" <?php if($request['ser_key']=="abb"){echo 'selected';} ?>>拼音缩写</option>
      </select>
      <input type="text" class="textbox" name="ser_val" id="ser_val" value="<?php echo $request['ser_val']; ?>" placeholder=""/>
      <input type="hidden" class="pid" name="pid" id="pid" value="<?php echo $pid; ?>"/>
       
      <input type="button" value="搜索" class="group_btn research" id="resource" page="1" />
       <?php
	    if( ( in_array(21001,$ruleLists) || $global==1) )
		{
    	?>
      <input type="button"  power="21001" value="添加" class="group_btn add fr" />
       <?php
        }
		?>
      <br style="clear:both;width:0px;height:0px;">
     </section>
 
       
   
<table class="table" style="margin-top:10px;">

<tr>

<th>ID</th>
<th>顶级分类</th>
<th>子项分类</th>

<th>拼音缩写</th>

<th >操作</th>
</tr>

<?php 
foreach($lists['data'] as $key=>$val)
{
?>
<tr data-id="<?php echo $val['id']; ?>">

<td style="width:60px;"><?php echo $val['id'];?></td>
<td style="width:120px;"><?php echo $LastDep['dname']; ?></td>
<td style="width:120px;"><?php echo $val['dname'];?></td>
<td style="width:120px;"><?php echo $val['abb'];?></td>





<td style="text-align:right;width:240px;">


		<?php
	    if( ( in_array(21002,$ruleLists) || $global==1) )
		{
    	?>
<input type="button" power="21002" value="修改" class="link_btn edit"/>
		<?php
        }
		?>
		<?php
	    if( ( in_array(21003,$ruleLists) || $global==1) )
		{
    	?>
<input type="button" power="21003" value="删除" class="link_btn del"/>
		<?php
        }
		?>
</td>
</tr>
      <?php
      }
	  ?>
</table>
{include file="../application/admin/view/layout/page_tpl_new.html" /}
      <script type="text/javascript">
      
      function myResearch(){
		   var url="/admin/devtype2/lists";
		   var ser_key =$("#ser_key").val();
		   var ser_val =$("#ser_val").val();
		   var pid =$("#pid").val();
		 
		
		   var page=$("#cpage").val();
		   var param={
				   ser_key:ser_key, 
				   ser_val:ser_val, 
				   pid:pid,
				  
				   page:page
		   };
		   ContentGet(url,param);
	   }
     
      
           $(function(){
        	   //设置搜索栏
        	   $(".research").click(function(){
        		   var page =$(this).attr("page");
        		   $("#cpage").val(page);
        		   myResearch();
        		   
        	   });
        	   
        	   $(".del").unbind();
        	   //删除项
        	   $('.del').click(function(){
        		   var pid =$("#pid").val();
        		   var that =this;
        		   var url="/admin/devtype2/delData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id,
        				   pid:pid
        		   };
        		   cofirmsss_tishi(1,'您确定要删除吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   
            				   $(that).parent().parent().remove();
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi(data.msg);
            			   }
            		   });
        			   
        		   });
        	   });
        	   
        	   $(".edit").unbind();
        	   //编辑项
        	   $(".edit").click(function(){
        		   var pid =$("#pid").val();
        		   var that =this;
        		   var url="/admin/devtype2/editData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id,
        				   pid:pid
        		   };
        		   MyContentLoad(url,param);
        				 
        				
        			 //弹出：确认按钮
        			
        	   });

        	  
        	   
        	   //导航
         	   $(".topBannerItem").click(function(){
         		   
         		   var attArr = $(this).attr();
             	   goToSelfLink(attArr);
             	   
         			
         	   });
         	  $(".add").unbind();
        	   //编辑项
        	   $(".add").click(function(){
        		   var pid =$("#pid").val();
        		   var that =this;
        		   var url="/admin/devtype2/addData";
        		   var param={pid:pid};
        		   MyContentLoad(url,param);
        			 //弹出：确认按钮
        			
        	   });
        	   
  			   //全选
  		
  				$("#all").click(function(){   
			    	if(this.checked){   
			        	$(".checkBoxInput").attr("checked", true);  
			        	$(".checkBoxInput").prop("checked", true);  
			    	}else{   
						$(".checkBoxInput").attr("checked", false);
						$(".checkBoxInput").prop("checked", false);
			    	}   
			    	var se=getAllSelectItem();
			    	//console.log(se);
			 	}); 
  			   
  			
           });
           
	  </script>
   